package top.boycharse.talker.bean.api.account;

import com.google.gson.annotations.Expose;
import top.boycharse.talker.bean.card.UserCard;
import top.boycharse.talker.bean.db.User;

public class AccountRspModel {

    /**
     * 用户基本信息
     */
    @Expose
    private UserCard user;

    /**
     * 当前登录的账号
     */
    @Expose
    private String account;

    /**
     * 当前登录后获取的token
     */
    @Expose
    private String token;

    /**
     * 是否已经绑定到了设备上的pushId
     */
    @Expose
    private boolean isBind;

    /**
     * 只带一个参数的构造器，默认没有绑定设备id
     * @param user 用户信息
     */
    public AccountRspModel(User user) {
        this(user, false);
    }

    public AccountRspModel(User user, boolean isBind) {
        this.user = new UserCard(user);
        this.account = user.getPhone();
        this.token = user.getToken();
        this.isBind = isBind;
    }

    public UserCard getUser() {
        return user;
    }

    public void setUser(UserCard user) {
        this.user = user;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public boolean isBind() {
        return isBind;
    }

    public void setBind(boolean bind) {
        isBind = bind;
    }
}
